import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
let aa = "http://192.168.100.106:8881/top/"
// let aa = "http://192.168.2.14:8081/"
export const store = new Vuex.Store({
	state: {
		users: [
				{id:1,name:"rebecca",registered: false},
				{id:2,name:'Tom',registered: false},
				{id:3,name:'Json',registered: false},
				{id:4,name:'Lily',registered: true},
				{id:5,name:'Pig',registered: false}
			],
		registrations:[
			{id:1,name:'Max'}
		],
		rests:{
		  saveinfo:{
			  url: 'http://192.168.2.14:8080/merchants/completeBpInfo',
				  postData: {
				  }
			  },
			register:{
				comment:"1.商户注册或登录接口",
				url:aa + 'api/merchants/loginOrRegister',
				param: {"merchantInfo":{"mobile":"18815283024"},"smsValidCode":"99999"}
			},
			verifyCard:{
				comment:"2.商户验证银行卡",
					url:aa + 'api/merchants/verifyCard',
				param: {"sevi{ssionId":"","identityName":"","identityNo":"","bankCardNo":"","bizScenario":""}
			},
			addCard :{
				comment:"商户添加卡信息",
					url:aa + 'api/merchantCard/addCard',
				param: {
					"sessionId":"ed852194-ceb9-4316-b3cb-ef972f96d233","cardProductInfo":{"state":"normal","name":"card1","price":"1200","quantity":"3000","expireDate":"360","denomination":"150000","cardType":"normal"}
				}
			},

			ssendSms:{
				comment:"4.商户绑卡",
				url:aa + '/api/merchants/sendSms',
				param: {"sessionId":""}
			},
			ssendSms:{
				comment:"4.商户绑卡",
				url:aa + 'api/merchants/sendSms',
				param: {"sessionId":""}
			},
			completeMerchantInfo:{
				comment:"5.商户完善信息",
				url:aa + 'api/merchants/completeMerchantInfo',
				param: {
					"merchantInfo":
					{"bpName":"ww","categoryNo":"11","address":"1",
					"contactNumber":"1","note":"1","businessHours":"1"},
					  "sessionId":
					"97f72fb8-d600-4d13-a1b2-9e25cd3ee6c2",
					"imageModels":[{"imageUrl":"","imageState":"normal"}]
				}
			},
			getMerchCategory:{
				comment:"6.查询商户分类",
				url:aa +'api/merchants/getMerchCategory',
				param:{}
			},
			getMerchantInfo:{
				comment:"7.查询商户信息",
				url:aa + 'api/merchants/getMerchantInfo',
				param: {"sessionId":""}
			},

			getMerchCategory:{
				comment:"8.查询商户分类",
				url:aa + 'api/merchants/getMerchCategory',
				param: {"sessionId":"","bpName":"","categoryNo":"","address":"","contactNumber":"","note":"","businessHours":""}
			}

		}

	},
        getters: {
		unregistered (state) {
			return state.users.filter(user => {
				return !user.registered;
			})
		}
	},
	mutations: {
	}
})
